package com.qqtech.qquan.coupon.dao;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.qqtech.core.frame.dao.BaseDaoImpl;
import com.qqtech.qquan.coupon.model.*;

@Repository
public class CouponBaseDaoImpl extends BaseDaoImpl<CouponBase> implements CouponBaseDao {
	public static final Logger log = LoggerFactory.getLogger(CouponBaseDaoImpl.class);

	@Override
	public int updateMinusQuantity(Integer id, Integer quantity) {
		CouponBase entity = new CouponBase();
		entity.setId(id);
		entity.setQuantity(quantity);
		return sqlSessionTemplate.update(getSqlName("updateMinusQuantity"), entity);
	}

	@Override
	public int updateIsNull(Integer id) {
		return sqlSessionTemplate.update(getSqlName("updateIsNull"), id);
	}
	
}
